<template>
  <div id='tmpl'>
   <div class="mui-content" style="background-color:#fff">
		    <ul class="mui-table-view mui-grid-view">
		        <li class="mui-table-view-cell mui-media mui-col-xs-6" v-for="item in list">
		            <a href="#">
		                <img class="mui-media-object" :src="item.img_url">
		                <div class="mui-media-body">{{item.title}}</div>
                    <div class="desc">
                      <p><span>{{item.sell_price}}</span> <s>{{item.market_price}}</s> </p>
                      <p><span>热卖中</span><span>{{item.stock_quantity}}</span></p>
                    </div>
                 </a>
            </li>
		    </ul>
		</div>

  </div>
</template>
<script>
import {Toast} from 'mint-ui'
export default {
  	data:function(){
			return {list:
				[]
			}
		},
		methods:{
			goodsList:function(){
				var url = this.$common+'/api/getgoods?pageindex=1';
				this.$http.get(url).then(function(res){
					var data = res.body;
					if(data.status != 0){
						Toast(data.message)
            return;
					};
					this.list = data.message;
				})
			}	
		},
		created(){
			this.goodsList()
		}
}
</script>
<style lang="css" scoped>
#tmpl{
  padding: 0 5px;
}
.mui-table-view{
  border:2px solid #000;
}
.mui-table-view-cell{
  border-right:1px solid gray;
  border-bottom:1px solid gray;
  padding-left:0px; 
}
.desc{
  height: 60px;
  background-color: gray;
}
</style>